<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/19 0019
  Time: 9:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>新建客户</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body>
<form class="layui-form">
    <%--${sessionScope.users.account}--%>
    <input type="hidden" name="creator" value="admin">
    <div class="layui-form-item" style="background: yellow; width: 900px">
        <label class="layui-form-label" >公司信息</label>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">客户名称*：</label>
        <div class="layui-input-inline">
            <input type="text" name="name" autocomplete="off" placeholder="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">公司电话：</label>
            <div class="layui-input-inline">
                <input type="text" name="company_phone" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户状态：</label>
            <div class="layui-input-inline">
                <select name="status">
                    <option value="">请选择</option>
                    <option value="0">成交客户</option>
                    <option value="1">潜在客户</option>
                    <option value="2">意向客户</option>
                    <option value="3">失败客户</option>
                    <option value="4">已流失客户</option>
                </select>
            </div>
            <div class="layui-form-mid" style="color: cornflowerblue">+编辑</div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">意向产品：</label>
            <div class="layui-form-mid layui-word-aux">产品名称</div>
            <div class="layui-form-mid" style="color: cornflowerblue">+选择</div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" style="margin-left: 85px">客户类别：</label>
            <div class="layui-input-inline">
                <select name="type">
                    <option value="">请选择</option>
                    <option value="1">普通客户</option>
                    <option value="2">VIP客户</option>
                    <option value="3">老客户</option>
                    <option value="4">代理商</option>
                    <option value="5">供应商</option>
                    <option value="6">合作伙伴</option>
                    <option value="7">其他</option>
                </select>
            </div>
            <div class="layui-form-mid" style="color: cornflowerblue">+编辑</div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户来源：</label>
            <div class="layui-input-inline">
                <select name="source">
                    <option value="">请选择</option>
                    <option value="1">注册会员</option>
                    <option value="2">朋友介绍</option>
                    <option value="3">手工录入</option>
                    <option value="4">客户介绍</option>
                    <option value="5">电子商务</option>
                    <option value="6">合作伙伴</option>
                    <option value="7">广告</option>
                    <option value="8">职员引介</option>
                    <option value="9">市场活动</option>
                    <option value="10">口头传达</option>
                    <option value="11">其他</option>
                </select>
            </div>
<%--            <div class="layui-form-mid" style="color: cornflowerblue">+编辑</div>--%>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户等级：</label>
            <div class="layui-input-inline">
                <select name="level">
                    <option value="">请选择</option>
                    <option value="1">☆</option>
                    <option value="2">☆☆</option>
                    <option value="3">☆☆☆</option>
                    <option value="4">☆☆☆☆</option>
                    <option value="5">☆☆☆☆☆</option>
                </select>
            </div>
            <div class="layui-form-mid" style="color: cornflowerblue">+编辑</div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户信用度：</label>
            <div class="layui-input-inline">
                <select name="credit">
                    <option value="">请选择</option>
                    <option value="1">☆</option>
                    <option value="2">☆☆</option>
                    <option value="3">☆☆☆</option>
                    <option value="4">☆☆☆☆</option>
                    <option value="5">☆☆☆☆☆</option>
                </select>
            </div>
            <%--            <div class="layui-form-mid" style="color: cornflowerblue">+编辑</div>--%>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户成熟度：</label>
            <div class="layui-input-inline">
                <select name="maturity">
                    <option value="">请选择</option>
                    <option value="1">A+：明确成交意向</option>
                    <option value="2">A-：有初步成交意向</option>
                    <option value="3">B+：关键人有成交意向</option>
                    <option value="4">B-：关键人成交意向不确定</option>
                    <option value="5">C+：初步联系，有意向</option>
                    <option value="6">C-：初步联系，意向不确定</option>
                    <option value="7">D：新建客户</option>
                    <option value="8">E：明显拒绝</option>
                    <option value="9">F：无效客户</option>
                </select>
            </div>
            <div class="layui-form-mid" style="color: cornflowerblue">+编辑</div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">所在地区：</label>
            <div class="layui-input-inline">
                <input type="text" name="area" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">邮政编码：</label>
            <div class="layui-input-inline">
                <input type="text" name="post_code" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">详细地址：</label>
        <div class="layui-input-inline">
            <input style="width: 600px" type="text" name="company_address" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">相关文件：</label>
        <div class="layui-form-mid layui-word-aux">只可上传一个文件</div>
        <div class="layui-form-mid ">选择文件</div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">客户介绍：</label>
        <div class="layui-input-inline">
            <textarea name="description" cols="80" placeholder="" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">传真地址：</label>
            <div class="layui-input-inline">
                <input type="text" name="fax_address" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">公司网站：</label>
            <div class="layui-input-inline">
                <input type="text" name="company_website" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">法人：</label>
            <div class="layui-input-inline">
                <input type="text" name="corporation" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">开户银行：</label>
            <div class="layui-input-inline">
                <input type="text" name="deposit_bank" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">银行账号：</label>
        <div class="layui-input-block">
            <input type="text" style="width: 600px" name="bank_account" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">年营业额：</label>
        <div class="layui-input-block">
            <input type="text" style="width: 600px" name="annual_sale" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">营业执照注册号：</label>
        <div class="layui-input-block">
            <input type="text" style="width: 600px" name="license_number" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">地税登记号：</label>
        <div class="layui-input-block">
            <input type="text" style="width: 600px" name="land_tax_number" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">国税登记号：</label>
        <div class="layui-input-block">
            <input type="text" style="width: 600px" name="national_tax_number" autocomplete="off" class="layui-input">
        </div>
    </div>
<%--    <div class="layui-form-item" style="background: yellow; width: 900px">--%>
<%--        <label class="layui-form-label" >主要联系人</label>--%>
<%--    </div>--%>
<%--    <div class="layui-form-item">--%>
<%--        <div class="layui-inline">--%>
<%--            <label class="layui-form-label">姓名*：</label>--%>
<%--            <div class="layui-input-inline">--%>
<%--                <input type="text" name="linkman.name" autocomplete="off" class="layui-input">--%>
<%--            </div>--%>
<%--        </div>--%>
<%--        <div class="layui-inline">--%>
<%--            <label class="layui-form-label">生日：</label>--%>
<%--            <div class="layui-input-inline">--%>
<%--                <input type="text" name="linkman.birthday" autocomplete="off" class="layui-input">--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--    <div class="layui-form-item">--%>
<%--        <label class="layui-form-label">性别：</label>--%>
<%--        <div class="layui-input-block">--%>
<%--            <input type="radio" name="linkman.sex" value="男" title="男">--%>
<%--            <input type="radio" name="linkman.sex" value="女" title="女">--%>
<%--        </div>--%>
<%--    </div>--%>
<%--    <div class="layui-form-item">--%>
<%--        <div class="layui-inline">--%>
<%--            <label class="layui-form-label">办公室电话：</label>--%>
<%--            <div class="layui-input-inline">--%>
<%--                <input type="text" name="linkman.office_phone" autocomplete="off" class="layui-input">--%>
<%--            </div>--%>
<%--        </div>--%>
<%--        <div class="layui-inline">--%>
<%--            <label class="layui-form-label">手机电话：</label>--%>
<%--            <div class="layui-input-inline">--%>
<%--                <input type="text" name="linkman.mobile_phone" autocomplete="off" class="layui-input">--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
    <div class="layui-form-item" style="width: 450px">
        <div class="layui-input-block">
            <button class="layui-btn" style="margin-left: 135px;">重置</button>
            <button lay-submit lay-filter="save" class="layui-btn">保存</button>
        </div>
    </div>
</form>

<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
    //layui引入特定模块的方式
    layui.use(['layer', 'form','jquery'], function(){
        var layer = layui.layer//layer:弹窗对象
            ,form = layui.form;//表单对象
        var $=layui.$;

        layer.msg('Hello World');
        //表单提交监听
        form.on("submit(save)",function (data) {
            //发起异步请求，新增
            $.post("${pageContext.request.contextPath}/customer/add",data.field,function (result) {
                if (result.code==0){
                    layer.msg("新建客户成功")
                    //刷新父窗口的表格
                    parent.layui.table.reload("customerTable",{
                        page:{
                            curr:1
                        }
                    })
                    //关闭本窗口
                    //当你在iframe页面关闭自身时
                    var index=parent.layer.getFrameIndex(window.name);//先得到当前iframe层的索引
                    parent.layer.close(index);//再执行关闭
                }
            },"json")
            return false;
        })
    });
</script>

</body>
</html>






















































